<!-- 运行台账-设备PID图 -->
<template>
  <div :class="{ 'equip-pid-wrap': url, 'equip-pid-wrap-visual': !url }">
    <iframe v-if="url" width="100%" height="100%" name="RUNMANAGE_STATUS_PID" frameborder="0" :src="url" />
    <Visual v-else class="visual" :twin-id="eqpId" is-preview="1" type="EQP" />
  </div>
</template>

<script setup lang="ts">
import { PxMessage } from "px-ui";
import Visual from "@/views/all/visual/template/index.vue";
const props = defineProps(["pidUrl", "eqpId"]);

let url = "";
if (props.pidUrl) {
  url = props.pidUrl;
}
</script>

<style lang="scss" scoped>
.equip-pid-wrap {
  width: 100%;
  height: calc(100vh - 265px);
  padding: 32px;
  margin-top: 16px;
  border: 1px solid #dcdcdc;
}

.equip-pid-wrap-visual {
  width: 100%;
  height: calc(100vh - 265px);
  margin-top: 16px;
  border: 1px solid #dcdcdc;

  .visual {
    width: 100%;
    height: 100%;
  }
}
</style>
